package com.wyj.event;

import com.wyj.config.RabbitConfig;
import lombok.extern.log4j.Log4j;
import lombok.extern.log4j.Log4j2;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
@Log4j2
public class RabbitProducer {

    @Autowired
    AmqpTemplate amqpTemplate;

    public void send(String msg) {
        log.info("生产者发送消息");
        amqpTemplate.convertAndSend(RabbitConfig.QUEUE_FIRST ,msg);
    }

}
